package model

import (
	"demo/infra/common/utils"
	"time"
)

type VisitStatistics struct {
	ID                          int64          `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
	StatisticsDate              utils.DateOnly `gorm:"column:statistics_date" json:"statistics_date"`
	PVCount                     int64          `gorm:"column:pv_count" json:"pv_count"`
	UVCount                     int64          `gorm:"column:uv_count" json:"uv_count"`
	IPCount                     int64          `gorm:"column:ip_count" json:"ip_count"`
	EffectiveRedirectionCount   int64          `gorm:"column:effective_redirection_count" json:"effective_redirection_count"`
	IneffectiveRedirectionCount int64          `gorm:"column:ineffective_redirection_count" json:"ineffective_redirection_count"`
	CompressCode                string         `gorm:"column:compress_code" json:"compress_code"`
	ShortURLDigest              string         `gorm:"column:short_url_digest" json:"short_url_digest"`
	LongURL                     string         `gorm:"column:long_url" json:"long_url"`
	LongURLDigest               string         `gorm:"column:long_url_digest" json:"long_url_digest"`
	CreateTime                  time.Time      `gorm:"column:create_time;autoCreateTime" json:"create_time"`
	EditTime                    time.Time      `gorm:"column:edit_time;autoUpdateTime" json:"edit_time"`
	Creator                     string         `gorm:"column:creator" json:"creator"`
	Editor                      string         `gorm:"column:editor" json:"editor"`
	Deleted                     int16          `gorm:"column:deleted" json:"deleted"`
	Version                     int64          `gorm:"column:version" json:"version"`
}

func (VisitStatistics) TableName() string {
	return "visit_statistics"
}
